###########################################
#                                         #
# New Immersive Events v. 0.01a           #
# Rulership Events: Part 6                #
# ID NIE.150-NIE.151                      #
# Written and edited by Erbkaiser		  #
#                                         #
###########################################

#copied & modified from AGOT
# Prison rape
character_event = {
	id = NIE.150	
	
	is_triggered_only = yes 
	show_from_from = yes
	
	desc = EVTDESC_NIE_150
	picture = "GFX_evt_lovers"
	
	option = {
		name = "OK"
		if = {
			limit = {
				fertility = 0.66
				FROM = { fertility = 0.66 }
			}	
			random_list = {
				85 = { impregnate = FROM }
				15 = { health = 0.01 }
			}
		}
		if = { 
			limit = { 
				fertility = 0.33
				FROM = { fertility = 0.33 }
				OR = {
					NOT = { fertility = 0.66 }
					FROM = { NOT = { fertility = 0.66 } }
				}
			}
			random_list = {
				50 = { impregnate = FROM }
				50 = { health = 0.01 }
			}
		}	
		if = { 
			limit = { 
				fertility = 0.1
				FROM = { fertility = 0.1 }
				OR = {
					NOT = { fertility = 0.33 }
					FROM = { NOT = { fertility = 0.33 } }
				}
			}
			random_list = {
				15 = { impregnate = FROM }
				85 = { health = 0.01 }
			}
			if = { #if forced impregnated flag as such
				limit = {
					prisoner = yes
					is_pregnant = yes
					host = { character = FROM }
				}
				set_character_flag = forced_child
			}
		}
	}
}

###
#Cleanup event in case thief sister marries ruler through another event
character_event = {
	id = NIE.151
	title = "EVTNAMENIE.151"
	desc = EVTDESC_NIE_151
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_economy

	capable_only = yes
	only_playable = yes
	prisoner = no

	trigger = {
		any_spouse = {
			trait = thief_sister_trait
		}
	}
	
	immediate = {
		any_spouse  = {
			limit = {
				trait = thief_sister_trait
			}
			save_event_target_as = thief_sister_target
		}
	}
	option = {
		name = EVTOPTA_NIE_151
		custom_tooltip = { text = Sister_end_marry }
		hidden_tooltip = {
			event_target:thief_sister_target = {
				remove_trait = thief_sister_trait
				diplomatic_immunity = no
			}
		}
	}
}